﻿using LimaLims.Application.Service.Role;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LimaLims.Application.Service.Cache
{
    /// <summary>
    /// 缓存服务接口
    /// </summary>
    public interface ISysCacheService
    {
        Task AddCacheKey(string cacheKey);

        Task DelByPatternAsync(string key);

        Task DelCacheKey(string cacheKey);

        bool Exists(string cacheKey);

        Task<List<string>> GetAllCacheKeys();

        Task<T> GetAsync<T>(string cacheKey);

        Task<List<string>> GetPermission(long userId);

        Task RemovePermission(long userId);

        Task<string> GetStringAsync(string cacheKey);

        Task RemoveAsync(string key);

        Task SetAsync(string cacheKey, object value);

        //Task SetDataScope(long userId, List<long> dataScopes);

        Task SetPermission(long userId, List<string> permissions);

        Task SetStringAsync(string cacheKey, string value);

        Task SetMenu(long userId, List<ElementTreeNode> menus);

        Task<List<ElementTreeNode>> GetMenu(long userId);
    }
}
